<template>
  <div class="hello">
    <h2>{{ msg }}</h2>
    <div class="info-card">
      <h3>🚀 快速开始</h3>
      <div class="commands">
        <div class="command">
          <code>npm install</code>
          <span>安装依赖</span>
        </div>
        <div class="command">
          <code>npm run dev</code>
          <span>启动 Vite 开发服务器</span>
        </div>
        <div class="command">
          <code>npm run electron:dev</code>
          <span>启动 Electron 应用（开发模式）</span>
        </div>
        <div class="command">
          <code>npm run electron:build</code>
          <span>构建 Electron 应用</span>
        </div>
      </div>
    </div>
    
    <div class="features">
      <div class="feature-card">
        <h4>⚡️ Vite</h4>
        <p>极速的开发服务器和构建工具</p>
      </div>
      <div class="feature-card">
        <h4>💚 Vue 3</h4>
        <p>渐进式 JavaScript 框架</p>
      </div>
      <div class="feature-card">
        <h4>🖥️ Electron</h4>
        <p>使用 Web 技术构建桌面应用</p>
      </div>
    </div>

    <div class="counter-demo">
      <button @click="count++">点击次数: {{ count }}</button>
      <p>编辑 <code>src/components/HelloWorld.vue</code> 开始开发</p>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'

defineProps({
  msg: String
})

const count = ref(0)
</script>

<style scoped>
.hello {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

h2 {
  font-size: 2em;
  margin-bottom: 30px;
  color: #42b883;
}

.info-card {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 25px;
  margin: 30px 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.info-card h3 {
  margin-bottom: 20px;
  color: #35495e;
}

.commands {
  display: flex;
  flex-direction: column;
  gap: 15px;
  text-align: left;
}

.command {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px;
  background: white;
  border-radius: 8px;
  border-left: 4px solid #42b883;
}

.command code {
  background: #f1f3f5;
  padding: 6px 12px;
  border-radius: 6px;
  font-family: 'Courier New', Courier, monospace;
  color: #c7254e;
  font-weight: 600;
  min-width: 200px;
}

.command span {
  color: #666;
  font-size: 0.9em;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.feature-card {
  background: white;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 25px;
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: #42b883;
}

.feature-card h4 {
  font-size: 1.3em;
  margin-bottom: 10px;
  color: #35495e;
}

.feature-card p {
  color: #666;
  line-height: 1.6;
}

.counter-demo {
  margin-top: 40px;
}

.counter-demo button {
  background: linear-gradient(45deg, #42b883, #35495e);
  color: white;
  border: none;
  padding: 12px 30px;
  font-size: 1.1em;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

.counter-demo button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(66, 184, 131, 0.4);
}

.counter-demo p {
  margin-top: 20px;
  color: #666;
  font-size: 0.95em;
}

code {
  background: #f1f3f5;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: 'Courier New', Courier, monospace;
  color: #c7254e;
}
</style>

